package com.haixiaoke.saas.houseMember.mapper;

import com.haixiaoke.saas.houseMember.domain.HouseMember;
import org.apache.ibatis.annotations.Param;

import java.util.List;


/**
 * 房屋成员Mapper接口
 *
 * @author qixi
 * @date 2024-03-07
 */
public interface HouseMemberMapper {
    /**
     * 查询房屋成员
     *
     * @param memberId 房屋成员主键
     * @return 房屋成员
     */
    HouseMember selectHouseMemberByMemberId(Long memberId);

    /**
     * 查询房屋成员列表
     *
     * @param houseMember 房屋成员
     * @return 房屋成员集合
     */
    List<HouseMember> selectHouseMemberList(HouseMember houseMember);

    /**
     * 新增房屋成员
     *
     * @param houseMember 房屋成员
     * @return 结果
     */
    int insertHouseMember(HouseMember houseMember);

    /**
     * 修改房屋成员
     *
     * @param houseMember 房屋成员
     * @return 结果
     */
    int updateHouseMember(HouseMember houseMember);

    /**
     * 删除房屋成员
     *
     * @param memberId 房屋成员主键
     * @return 结果
     */
    int deleteHouseMemberByMemberId(Long memberId);

    /**
     * 批量删除房屋成员
     *
     * @param memberIds 需要删除的数据主键集合
     * @return 结果
     */
    int deleteHouseMemberByMemberIds(Long[] memberIds);

    int countMemberNumberByOrderId(String orderId);

    List<HouseMember> selectHouseMemberListByOrderId(String orderId);

    List<HouseMember> selectHouseMemberByMemberIds(Long[] memberIds);

    int rentingTerminationByOrderId(String orderId);

    /**
     * 批量插入房屋成员
     *
     * @param houseMemberList
     * @return
     */
    int insertBatchHouseMember(List<HouseMember> houseMemberList);

    HouseMember selectHouseMemberListByMemberPhone(@Param("memberPhone") String memberPhone, @Param("orderId") String orderId);

    int updateHouseIdByOrderId(@Param("orderId") String orderId, @Param("houseId") String houseId);

    List<HouseMember> selectHouseMemberListAndOrderId(HouseMember houseMember);

    HouseMember selectHouseMemberByUserIdAndOrderId(@Param("userId") Long userId, @Param("orderId") String orderId);


    HouseMember selectHouseMemberListByIdCard(@Param("idCard") String idCard, @Param("orderId") String orderId);

    List<HouseMember> selectHouseMemberListByHouseId(String houseId);

    int updateBatchHouseMember(List<HouseMember> houseMemberList);

    int deleteHouseMemberByOrderId(String orderId);

    int deleteHouseMemberByOrderIds(List<String> orderIds);

    HouseMember selectHouseMemberByHouseIdAndUserId(@Param("houseId") String houseId, @Param("userId") Long userId);
}
